"""
Use to check contents of an egg against a file...

python -m diffegg egg file1 file2
egg is an egg
file1 is in the egg
file2 is outside the egg
"""

from zipfile import ZipFile
from sys import argv, exit, stdout
from difflib import Differ

if len(argv)!=4:
   print __doc__
   exit()
text1 = [s+'\n' for s in ZipFile(argv[1]).read(argv[2]).split('\n')]
text2 = open(argv[3]).readlines()

stdout.writelines( list(Differ().compare(text1, text2)) )
